/*
 * Eugen Stoian <stoian.e@gmail.com> 2010
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef PROJECT_H
#define PROJECT_H

#include <QObject>


class Expression3D;
class ParametricObject3D;
class Surface3D;
class Curve3D;

class Project : public QObject
{
    Q_OBJECT
public:
    Project(const QString& name,QObject *parent = 0);
    const QList<Expression3D*>& expressions() const {
        return _expressions;
    }
    void addExpression(Expression3D* expr);
    void deleteExpression(const QString& name);
    void addCurve(Curve3D* curve);
    void addSurface(Surface3D* curve);
    void addPlot(ParametricObject3D* pp);
    void deletePlot(const QString& name);
    Expression3D* findExpression(const QString& name);
    ParametricObject3D* findObject(const QString& name);
    void cleanUp();
    friend class ProjectView;
    friend QDataStream& operator<<(QDataStream& stream, const Project& p);
    friend QDataStream& operator>>(QDataStream& stream, Project& p);
signals:
    void changed();
private:
    QList<Expression3D*> _expressions;
    QList<ParametricObject3D*> _plots;
    bool _changed;
};

QDataStream& operator<<(QDataStream& stream, const Project& p);
QDataStream& operator>>(QDataStream& stream, Project& p);

#endif // PROJECT_H
